package com.shuidi.oilactivity.fragment;

import android.content.SharedPreferences;
import android.os.Bundle;
import android.support.v4.app.Fragment;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.TextView;

import com.shuidi.oilactivity.R;
import com.shuidi.oilactivity.activity.AdvertisementActivity;

import static android.content.Context.MODE_PRIVATE;


/**
 * Created by maxliaops on 17-1-6.
 */

public class UserCentralFragment extends Fragment {

    private TextView name;
    private TextView iphone;

    private SharedPreferences sharedPreferences;

    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container,
                             Bundle savedInstanceState) {
        View rootView = inflater.inflate(R.layout.fragment_usercentral, container, false);
        name = (TextView)rootView.findViewById(R.id.name);
        iphone = (TextView)rootView.findViewById(R.id.iphone);
        sharedPreferences = getContext().getSharedPreferences("userData",MODE_PRIVATE);
        name.setText(sharedPreferences.getString("name",""));
        iphone.setText(sharedPreferences.getString("iphone",""));

        return rootView;
    }
}
